<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
		<script src="./js/layui/layui.js"></script>
		<link rel="stylesheet" href="js/layui/css/layui.css" media="all"/>
		<style>
			.content{
				width: 1100px;
				height: 300px;
				border: 1px solid red;
				display: flex;
				justify-content: space-around;
				position: relative;
			}
			.content>.item{
				width: 300px;
				height: 300px;
				border: 1px solid black;
			}
			.icon{
				position: absolute;
				top:280px;
				left:150px;
			
			}
			.current{
				order:-1
			}
		</style>
	</head>
	<body>
		<div class="content">
		<div class="item item1">1</div>
		<div class="item item2 ">2</div>
		<div class="item item3">3</div>
		<div class="icon">
			<span class='layui-badge-dot layui-bg-gray' style='width: 15px;height: 15px;margin-right:10px;'></span>
			<span class='layui-badge-dot layui-bg-gray' style='width: 15px;height: 15px;margin-right:10px;'></span>
			<span class='layui-badge-dot layui-bg-gray' style='width: 15px;height: 15px;margin-right:10px;'></span>
		</div>
		</div>
		
		
		
			
		<script>
			
			$(function(){
				$(".icon span").each(function(i,el){
					$(".icon span").eq(i).hover(function(){
						console.log(i)
					$(".item").eq(i).siblings(".item").removeClass("current")
						$(".item").eq(i).addClass("current")
						console.log(i)
					},function(){})
				})
				
			})
		</script>
	</body>
</html>
